<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

</head>

<body>
    <input type="text" name="" id="num" value="89">
    <button id="btn">计算</button>
    <input type="text" name="" id="num1">天
    <input type="text" name="" id="num2">时
    <script>
        document.getElementById("btn").onclick = function() {
            //获取第一个数值
            var _num1 = Number(document.getElementById("num").value);
            //计算天数和小时  
            var
                a = parseInt(_num1 / 24),
                b = parseInt(_num1 % 24);

            document.getElementById("num1").value = a;
            document.getElementById("num2").value = b;

        }
    </script>
</body>

</html>